home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 44
/
Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso
/
Aminet
/
dev
/
gui
/
gtlayout.lha
/
Source
/
LTP_HexEditRoutine.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-01-02
|
2KB
|
105 lines
/*
** GadTools layout toolkit
**
** Copyright © 1993-1999 by Olaf `Olsen' Barthel
** Freely distributable.
**
** :ts=4
*/
#ifndef _GTLAYOUT_GLOBAL_H
#include "gtlayout_global.h"
#endif
/*****************************************************************************/
#include <intuition/sghooks.h> /* For struct SGWork */
/*****************************************************************************/
#include "Assert.h"
/*****************************************************************************/
#ifdef DO_HEXHOOK /* Support code */
ULONG SAVE_DS ASM
LTP_HexEditRoutine(REG(a0) struct Hook *hook,REG(a2) struct SGWork *sgw,REG(a1) Msg msg)
{
LayoutHandle *handle;
ObjectNode *node;
BOOL activate;
switch(msg->MethodID)
{
case SGH_KEY:
handle = hook->h_Data;
if(sgw->IEvent->ie_Code == 0x5F && handle->HelpHook)
{
sgw->Code = 0x5F;
sgw->Actions = (sgw->Actions & ~SGA_BEEP) | SGA_END | SGA_USE;
LTP_AddHistory(sgw);
break;
}
if(sgw->IEvent->ie_Code == CURSORUP || sgw->IEvent->ie_Code == CURSORDOWN)
LTP_HandleHistory(sgw);
activate = TRUE;
if(GETOBJECT(sgw->Gadget,node))
{
if(node->Type == INTEGER_KIND)
{
if(node->Special.Integer.LastGadget)
activate = FALSE;
if(!LTP_ConvertNum((node->Min < 0),sgw->WorkBuffer,(LONG *)&sgw->StringInfo->LongInt))
{
sgw->EditOp = EO_BADFORMAT;
sgw->Actions = SGA_BEEP;
}
if(node->Special.Integer.ValidateHook)
{
if(!CallHookPkt(node->Special.Integer.ValidateHook,sgw,msg))
{
sgw->EditOp = EO_BADFORMAT;
sgw->Actions = SGA_BEEP;
}
}
}
}
if(sgw->EditOp == EO_ENTER && !(sgw->IEvent->ie_Qualifier & QUALIFIER_SHIFT))
{
if(activate && handle->AutoActivate)
sgw->Actions |= SGA_NEXTACTIVE;
if(!(sgw->Actions & SGA_NEXTACTIVE))
sgw->Code = '\r';
}
if(sgw->Actions & SGA_END)
LTP_AddHistory(sgw);
/* Falls through to... */
case SGH_CLICK:
break;
default:
return(FALSE);
}
return(TRUE);
}
#endif /* DO_HEXHOOK */